#include<bits/stdc++.h>
using namespace std;
namespace IO
{
	char buff[1<<21],*p1=buff,*p2=buff;
	char getch(){return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;}
	template<typename T>void read(T &x){char ch=getch();int fl=1;x=0;while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}x*=fl;}
	template<typename T>void read_s(T &x){x="";char ch=getch();while(ch<'a'||ch>'z')ch=getch();while(ch>='a'&&ch<='z'){x+=ch;ch=getch();}}
	template<typename T,typename ...Args>void read(T &x,Args& ...args){read(x);read(args...);}
	char obuf[1<<21],*p3=obuf;
	void putch(char ch) {if(p3-obuf<(1<<21))*p3++=ch;else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;}
	char ch[100];
	template<typename T>void write(T x) {if(!x)return putch('0');if(x<0)putch('-'),x*=-1;int top=0;while(x)ch[++top]=x%10+48,x/=10;while(top)putch(ch[top]),top--;}
	template<typename T,typename ...Args>void write(T x,Args ...args) {write(x);write(args...);}
	void put(string s){for(int i=0;i<s.size();i++)putch(s[i]);}
	void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
struct node
{
	int nxt,to,val;
}e[114514];
int head[114514],cnt_edge=1;
void add_edge(int u,int v,int w)
{
	e[++cnt_edge].to=v;
	e[cnt_edge].val=w;
	e[cnt_edge].nxt=head[u];
	head[u]=cnt_edge;
	e[++cnt_edge].to=u;
	e[cnt_edge].val=-w;
	e[cnt_edge].nxt=head[v];
	head[v]=cnt_edge;
}
int n,m;
int nrad[114514],dep[114514];
int bfs()
{
	for(int i=0;i<=n+1;i++) dep[i]=1e9;
	queue<int>q;q.push(0);
	dep[0]=1;
	while(q.size())
	{
		int u=q.front();q.pop();
		nrad[u]=head[u];
		if(u==n+1) return 1;
		for(int i=head[u];i;i=e[i].nxt)
		{
			int v=e[i].to;
			if(dep[v]==1e9&&e[i].val>0) dep[v]=dep[u]+1,q.push(v); 
		}
	}
	return 0;
}
int dfs(int u,int inflow)
{
	if(u==n+1) return inflow;
	int outflow=0;
	for(int i=nrad[u];i;i=e[i].nxt)
	{
		int v=e[i].to;
		nrad[u]=i;
		if(dep[v]==dep[u]+1&&e[i].val>0)
		{
			int tmp=dfs(v,min(inflow,e[i].val));
			outflow+=tmp;inflow-=tmp;e[i].val-=tmp;e[i^1].val+=tmp;
		}
	}
	return outflow;
}
inline int dinic()
{
	int res=0;
	while(bfs()) res+=dfs(0,1e9);
	return res;
}
int ans[114514];
int u[114514],v[114514];
int main()
{
	freopen("cut.in","r",stdin);
	freopen("cut.out","w",stdout);
	read(n,m);
	for(int i=1;i<=m;i++) read(u[i],v[i]);
	memset(ans,0x3f,sizeof ans);
	for(int x=1;x<n;x++)
		for(int y=x+1;y<n;y++)
		{
			for(int i=0;i<=n+1;i++) head[i]=0;cnt_edge=1;
			for(int i=1;i<n;i++)
				if(i!=x&&i!=y) add_edge(u[i],v[i],1e9),add_edge(v[i],u[i],1e9);
			for(int i=n;i<=m;i++) add_edge(u[i],v[i],1),add_edge(v[i],u[i],1);
			add_edge(0,u[x],1e9);add_edge(0,u[y],1e9);
			add_edge(v[x],n+1,1e9);add_edge(v[y],n+1,1e9);
			int tmp=dinic();
			ans[x]=min(ans[x],tmp);ans[y]=min(ans[y],tmp);
		}
	for(int i=1;i<n;i++) write(ans[i]+2),putch(' ');
	flush();
	return 0;
}
/*
5 8
1 2
1 3
1 4
4 5
2 3
3 4
5 2
5 3
*/
